Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(Monthly Balance Analysis) #3815

Merged
merged 5 commits into from
Jul 31, 2019

Conversation

lomamech
Copy link
Collaborator

  • Add new report for Analysis Monthly Balance of accounts

closes #3803

@kwilu kwilu added the size: XL label Jul 21, 2019
tree.walk(Tree.common.sumOnProperty(amount), false);
tree.walk(Tree.common.sumOnProperty(debit), false);
tree.walk(Tree.common.sumOnProperty(credit), false);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces not allowed no-trailing-spaces

// create the tree structure, filter by property and sum nodes' summableProp
function prepareTree(data, amount, debit, credit) {
// if the after result is 0, that means no movements occurred
const isEmptyRow = (row) => (
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'isEmptyRow' is assigned a value but never used no-unused-vars

sqlFilter = `OR (${sqlFilter})`;
}

sqlFilter = ` AND (ac.number LIKE '${account}%' ${sqlFilter})`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces not allowed no-trailing-spaces

if (accountArray.length > 1) {
for (let i = 0; i < accountArray.length; i++) {
accountFilter += `${accountArray[i]}`;
let conditionOr = (i < (accountArray.length - 1)) ? `OR` : ``;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'conditionOr' is never reassigned. Use 'const' instead prefer-const


if (accountArray.length > 1) {
for (let i = 0; i < accountArray.length; i++) {
accountFilter += `${accountArray[i]}`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces not allowed no-trailing-spaces

vm.reportDetails = angular.copy(cache.reportDetails);
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline required at end of file but not found eol-last

if (vm.reportDetails.allAccount) {
vm.reportDetails.accountNumber = null;
vm.reportDetails.accountLabel = null;
vm.reportDetails.accountId = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces not allowed no-trailing-spaces

vm.reportDetails = {};
vm.reportDetails.fiscal_id = null;
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon semi

// bind the accounts to the controller
let accounts = Accounts.order(elements);
vm.accounts = accounts;
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces not allowed no-trailing-spaces

Accounts.read()
.then(elements => {
// bind the accounts to the controller
let accounts = Accounts.order(elements);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'accounts' is never reassigned. Use 'const' instead prefer-const

let accountFilter = ``;
if (accountArray.length > 1) {
for (let i = 0; i < accountArray.length; i++) {
accountFilter += `${accountArray[i]}`;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces not allowed no-trailing-spaces

range = dateRange;
const sqlParams = [
params.fiscal_id,
params.period_id,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing spaces not allowed no-trailing-spaces

vm.reportDetails = angular.copy(cache.reportDetails);
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline required at end of file but not found eol-last

@lomamech
Copy link
Collaborator Author

image

@lomamech
Copy link
Collaborator Author

Rapport Mensuel.pdf

@lomamech
Copy link
Collaborator Author

@jniles @mbayopanda can you review this PR

Copy link
Collaborator

@mbayopanda mbayopanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A made a first review

@@ -69,6 +69,10 @@
"PROFIT_AND_LOSS_BY_YEAR": "Profit and Loss Statement By Fiscal Year",
"INCOME_REPORT": "Income Report",
"MONTHLY_BALANCE": "Monthly Balance",
"MONTHLY_ACCOUNT_ANALYSIS": {
"DESCRIPTION": "This report allows for monthly analysis of accounts",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you be more explicit, which kind of analysis ?

@@ -69,6 +69,10 @@
"PROFIT_AND_LOSS_BY_YEAR": "Profit and Loss Statement By Fiscal Year",
"INCOME_REPORT": "Income Report",
"MONTHLY_BALANCE": "Monthly Balance",
"MONTHLY_ACCOUNT_ANALYSIS": {
"DESCRIPTION": "This report allows for monthly analysis of accounts",
"TITLE": "Monthly Balance analysis"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Monthly Balance Analysis is not explicit for what for the report is.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the work, i saw the report and i think a good name can be something like "Monthly Balance" or "Periodic Balance" because it shows up the balance of a given period.

@@ -63,6 +63,10 @@
"PROFIT_AND_LOSS_BY_YEAR": "Rapport des Produit et des Charges par Années",
"INCOME_REPORT" : "Rapport des Recettes",
"MONTHLY_BALANCE" : "Balance Mensuelle",
"MONTHLY_ACCOUNT_ANALYSIS": {
"DESCRIPTION": "Ce rapport permet de faire l'analyse mensuel des comptes",
"TITLE": "Analyse mensuel de la Balance"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which kind of analysis ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Balance par mois" or "Balance par periode" can be good as title, since the report is just the balance for a given period

@@ -67,6 +67,7 @@
"IPR_TAX_CONFIGURATION": "Configuration de la taxe IPR",
"JOURNAL_VOUCHER":"Ajout Transactions",
"LOCATION":"Localisations",
"MONTHLT_ACCOUNT_ANALYSIS": "Analyse mensuel de la Balance",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MONTHLY_ACCOUNT_ANALYSIS may be

period-id="ReportConfigCtrl.reportDetails.period_id"
on-select-callback="ReportConfigCtrl.onSelectPeriod(period)">
</bh-period-selection>
<hr>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove these <hr> the final result let a lot of space in the user interface.

image

on-select-callback="ReportConfigCtrl.onSelectPeriod(period)">
</bh-period-selection>
<hr>
<div class="panel-body" ng-class="{'has-error' : ConfigForm.$submitted && ConfigForm.allAccount.$invalid }">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to remove this css class panel-body here

</div>
</div>
</div>
<hr>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this <hr>

filterByAccount = selectAccountParent(accountNumber);
} else {
filterByAccount = ``;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can write :

let filterByAccount = accountNumber ? selectAccountParent(accountNumber) : '';

if (accountNumber) {
filterByAccount = selectAccountParent(accountNumber);
} else {
filterByAccount = ``;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For your information, back quotes ```` are used for multi lines or if we want to insert a variable or an expression :

`My text and the value of the variable is ${myVariable}` 

or in multi-lines :

`
Line 1
Line 2
etc.
`

In this case, you can just write filterByAccount = '';

@jniles
Copy link
Collaborator

jniles commented Jul 26, 2019

@mbayopanda already did a reasonable review, but I'm just curious why this says "Produit"?
image

Copy link
Collaborator

@mbayopanda mbayopanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job @lomamech , i made just some comments the work is well done 👍

@@ -69,6 +69,10 @@
"PROFIT_AND_LOSS_BY_YEAR": "Profit and Loss Statement By Fiscal Year",
"INCOME_REPORT": "Income Report",
"MONTHLY_BALANCE": "Monthly Balance",
"MONTHLY_ACCOUNT_ANALYSIS": {
"DESCRIPTION": "This report allows for monthly analysis of accounts",
"TITLE": "Monthly Balance analysis"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the work, i saw the report and i think a good name can be something like "Monthly Balance" or "Periodic Balance" because it shows up the balance of a given period.

@@ -67,6 +67,7 @@
"IPR_TAX_CONFIGURATION" : "IPR Tax Configuration",
"JOURNAL_VOUCHER" : "Journal Voucher",
"LOCATION" : "Location Management",
"MONTHLY_ACCOUNT_ANALYSIS": "Monthly Balance analysis",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is just a balance of a given period, i think it is no more necessary to add Analysis

@@ -63,6 +63,10 @@
"PROFIT_AND_LOSS_BY_YEAR": "Rapport des Produit et des Charges par Années",
"INCOME_REPORT" : "Rapport des Recettes",
"MONTHLY_BALANCE" : "Balance Mensuelle",
"MONTHLY_ACCOUNT_ANALYSIS": {
"DESCRIPTION": "Ce rapport permet de faire l'analyse mensuel des comptes",
"TITLE": "Analyse mensuel de la Balance"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Balance par mois" or "Balance par periode" can be good as title, since the report is just the balance for a given period

@@ -67,6 +67,7 @@
"IPR_TAX_CONFIGURATION": "Configuration de la taxe IPR",
"JOURNAL_VOUCHER":"Ajout Transactions",
"LOCATION":"Localisations",
"MONTHLY_ACCOUNT_ANALYSIS": "Analyse mensuel de la Balance",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Balance par mois"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Balance Mensuel would be better than Monthly Balance

<h3 class="text-center text-uppercase">
<strong>{{translate 'REPORT.MONTHLY_ACCOUNT_ANALYSIS.TITLE'}}</strong> <br>
</h3>
<hr>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this <hr>


<h5 style="margin:15px; font-weight:bold" class="text-center text-uppercase">
{{periodLabel}}
</h5>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we select the period before accounts, i think period must be above account.

Here is a proposal:

<h3 class="text-center text-bold text-uppercase">{{translate 'REPORT.MONTHLY_ACCOUNT_ANALYSIS.TITLE'}}</h3>
<h3 class="text-center text-uppercase">{{periodLabel}}</h3>
<h4 class="text-center">{{this.accountNumber}}: {{this.accountLabel}}</h4>

lomamech added 5 commits July 31, 2019 16:30
- Add new report for Analysis Monthly Balance of accounts

closes Third-Culture-Software#3803
- Sanitaze code and improve report and translate key
- Rename Monthly Balance instead Monthly Balance Analysis
- Sanitaze code and refactor Report Design
@lomamech lomamech force-pushed the featureMonthlyBalance branch from 04a9c19 to 0ae1f6a Compare July 31, 2019 16:30
@lomamech
Copy link
Collaborator Author

@mbayopanda all test passed and code is review

Copy link
Collaborator

@mbayopanda mbayopanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

bors bot added a commit that referenced this pull request Jul 31, 2019
3815: feature(Monthly Balance Analysis) r=mbayopanda a=lomamech

- Add new report for Analysis Monthly Balance of accounts

closes #3803

Co-authored-by: Chris Lomame <lomamech@gmail.com>
@bors
Copy link
Contributor

bors bot commented Jul 31, 2019

Build succeeded

@bors bors bot merged commit 0ae1f6a into Third-Culture-Software:master Jul 31, 2019
@jniles jniles mentioned this pull request Aug 20, 2019
bors bot added a commit that referenced this pull request Aug 20, 2019
3853: Release v1.2.0 r=jniles a=jniles

🚀 Let's release bhima (currently at 1.1.1)


Changelog:
* chore: use release-it for releases (f4efd33)
* chore: rename migration path (37fe3b4)
* chore: dump dependencies before release (492ac19)
* Merge #3846 (c2f27c8)
* Merge #3849 (7a41977)
* bug(Cash box translation) - Fix untranslation key for user deactivated (b0f4fbe)
* Merge #3836 (f20d459)
* refactor(Make Exchange Rates human readable) - Addition of the minimum value of the exchange rate to prevent the   exchange rate equal to zero - Show exchange rates less than 0.1 as a fraction for example 1/1630   instead of 0.0006134 (c21e24a)
* Merge #3829 (28fdd28)
* test: run client unit tests on AppVeyor (a1c8968)
* chore: refactor testing code (64b3c96)
* test: remove server-unit from TravisCI (0357ec2)
* test: add appveyor to bors (b790a45)
* ci: add initial appveyor support (c235a97)
* Merge #3840 (8d3010a)
* fix: bump unit ids in the migration file (9bf73ee)
* chore(package): update eslint-config-airbnb-base to version 14.0.0 (6fbde6a)
* Merge #3834 (8774b09)
* handle negative values in stock report (57380f1)
* Merge #3833 (217d0d1)
* add translation in employee report (aee91f6)
* Merge #3832 (3578b7f)
* fix(Calcul Sum Distributed) - Around the sum distributed for escape error when percent as decimal (30dbc83)
* Merge #3799 (852b220)
* clean code (95f1e93)
* improvement(Employee Standing) - clean the representation of tabSQL - Capitalize creditoropeningbalance (01893e9)
* Sanitaze code (7268cad)
* improvement(Employee Standing) - Fix and Upgrate the translation key - Adding opening balance until a date from - Adding new function openingBlanceCreditor with parameters like   creditorUuid and datefrom (3588ff8)
* Sanitaze code (b914bca)
* refactor(Employee Standing) - Refactor and Sanitaze code (e115407)
* improvement(Improve Employees Standings report) - Add the possibility to visualize the employees standings by range of   date, by the adding of component date by bh-date-interval - Add filter by range of date (f4c4774)
* Merge #3827 (f1a7e6f)
* Merge #3828 (19f0753)
* fix(tests): no async forEach in merge patients (c4b257a)
* feat(report) debtor summary report (a835fb3)
* chore: update depends (b78ab2a)
* Merge #3825 (1326302)
* Merge #3794 (7ae875f)
* (cron job) add cron email componet to main reports (438b1ac)
* improvement(Invoicing Bug) - Restoring the old debtor balance request and modifying the   hasCreditorBalance calculation by analyzing whether the balance is   greater than 0.01 (b289a4e)
* Merge #3815 (d115442)
* improve(Monthly Balance) - Rename Monthly Balance instead Monthly Balance Analysis - Sanitaze code and refactor Report Design (0ae1f6a)
* Merge #3820 (64497cc)
* improvement(MonthlyBalance) - Sanitaze code and improve report and translate key (58cb1d0)
* Sanitaze code (1167990)
* Sanitaze code (9455a3d)
* feature(Monthly Balance Analysis) - Add new report for Analysis Monthly Balance of accounts (06d9f60)
* Merge #3801 (87edd98)
* remove toggle required (7c0f583)
* Improve and sanitaze code (b613b29)
* fix (Invoicing Bug) - resolution of the problem when calling the Debtors.balance function with rounding to two ranks after the decimal point of the total credit and debit values (1edfd7b)
* rename cashboxId to cashboxAccountId (f895692)
* fix component require condition for validation (00869ad)
* Enhance caution filter and fix cashflow by service report (a6bfc8b)
* Merge #3821 (2973736)
* fix stock adjustment deletion (ab9db1d)
* Sanitaze html form (3494521)
* improvement(Cash Flow Reports) - Adding Possibilty to view the detailed cashflow report (946e278)
* Merge #3813 (21d19d3)
* chore(package): update cz-conventional-changelog to version 3.0.0 (6c941a5)
* Merge #3808 (34fe9fc)
* Merge #3809 (f5d7fb2)
* chore(package): update commitizen to version 4.0.0 (2dfc6cb)
* chore(package): update gulp-if to version 3.0.0 (6af28e8)
* Merge #3797 (cda7c86)
* chore(package): update karma-chrome-launcher to version 3.0.0 (d3be817)
* Merge #3795 (0d5adeb)
* fix cron table on migration (8ad64ba)
* Merge #3767 (84b5af0)
* Merge remote-tracking branch 'upstream/master' into auto-email-reporting (ada6cd6)
* Merge #3775 (ce8af95)
* Merge #3785 (f50b9c6)
* fix e2e tests for cron emailing (e39aa2a)
* Merge #3777 (e30235b)
* fix(Payslip) - Restaure the management of off days in payslip - fix the displaying of daily rate for Holidays periods and offdays - Exted the periode of definition of offdays (713c4bf)
* Merge #3782 (14ae5ba)
* fix: .snyk & package.json to reduce vulnerabilities (b3c8d1a)
* Merge #3779 (47ba601)
* Merge #3780 (ad5115c)
* fix integration test (cd531cb)
* chore(package): update lockfile yarn.lock (3ef4a2d)
* chore(package): update del to version 5.0.0 (72c68d7)
* fix label index length (45e6dc3)
* improve(Employee Standing) - Adding option to include medical care provided to the employee - Update Report, display Employee Standing Status in Report closes #3778 (331d9c1)
* fix column length (bf3259c)
* fix: restaure old file (e2e1e4a)
* feature(Bhima User) - Complete Bhima User Manual (18a0514)
* fix entity parent (852144d)
* update report id length (842b864)
* fix: migration script typo (bf1157a)
* fix translations and unit test for bhMoment (8109ab7)
* fix migration file (e1edfba)
* dev environment (bb2b5ba)
* fix ui and integration tests for cron email report (d68d383)
* instant email send for reports (2bbd820)
* ohada_balance_sheet, ohada_income_expense, exploitation, balance emailing (ea4fac0)
* Form reset after submission and cron job fixing (7ab8b44)
* handle deletion and job stop (2101165)
* balance report by email and use of async await (b9cec59)
* sending email (af4b449)
* cron job for email report (54fc906)
* load report details (c8c9115)
* simple crud for cron email report (46d7a34)
* contact group management (f3c040f)
* feature(Bhima User Manual) - References accounts User Manual - Fee Center User Manual - Payroll User Manual (0aacc6a)
* Merge #3772 (78a657a)
* fix: rubrics config tests (c31beee)
* fix: flaky role management test (90a6fcb)
* Merge #3768 (a18c9f5)
* Merge #3770 (c65a8d5)
* chore: bump dependencies (96207a2)
* Merge #3724 (b244207)
* fix purchase reference (5f0dc18)
* Merge branch 'master' of https://github.com/IMA-WorldHealth/bhima into report-stock-entry (efc5e43)
* chore(package): update lockfile yarn.lock (c0f80d7)
* chore(package): update eslint to version 6.0.0 (e90a2e7)
* fix stock sheet report (ef42f3b)
* Capitalize report description and use of reportDetails correctly (0af0ec8)
* stock entry report (9b7f65c)
* Merge #3762 (d2bc25a)
* Merge branch 'master' into fix-depot-path (75ca9e2)
* Merge #3760 (c13c5a4)
* fix depot path (18d2eee)
* feat(component) bhperiod, use period translate_key as label (d061ecc)
* Merge #3759 (b7cc0d3)
* Merge #3736 (f95255b)
* Merge #3751 (30ea36d)
* add warning message for employees patients merge (3236947)
* Merge branch 'master' of https://github.com/IMA-WorldHealth/bhima into merge-patient-records (ff4f7da)
* chore(package): update lockfile yarn.lock (aef66b2)
* chore(package): update mochawesome to version 4.0.0 (21fe8dd)
* Merge #3752 (9880ae8)
* Merge #3757 (fc69b92)
* update action link column (200d0a7)
* updates integration and e2e tests (ce256bc)
* Split hospitalization indicators by projects (18d659b)
* count services by project (995a746)
* add project in service (8a9b6bd)
* Merge #3755 (752723a)
* Merge #3756 (480f324)
* fix: typos in migration script setup (3c9ed3e)
* Reset Numbers of vouchers in E2E test (f3345be)
* Restore number of vouchers in Ui grid (d9319af)
* Reset defaut number of vouchers (dde4bb0)
* test(Voucher Registry) - Update number of vouchers (6b7683a)
* improvement(Payroll Configuration) - Update the max length of abbreviation of rubrics - remove unused require - Before we had to prevent the edition of all the headings which were   taxes, but it can be made that there are taxes which is not calculated   expressed as a percentage, to allow the edition of this kind of tax, it   would be enough to exclude the only tax which is expressed as a   percentage neither and which is not nor éditable reason why we had   excluded the IPR - closes #3754 (b70ef8d)
* improvement(Payroll) - Sanitaze code remove unused require employees - Use the date to instead the current days for commitment of paiement in   accounting (c62c98f)
* Merge #3753 (80e2607)
* fix(invoice): primary key collision invoicing_fees (df82dad)
* fix selection list (b6681a6)
* Merge #3743 (1a3d919)
* reload page before each tests (a939788)
* fix price list report (b4471b5)
* integration tests and e2e tests of patients merge fetaure (93bd991)
* merge patients tool (a6ca2de)
* merge patients (5dc2a0b)
* chore(package): update merge-stream to version 2.0.0 (e8005ec)
* Merge #3732 (54212b3)
* Merge #3733 #3734 (b2eec0b)
* chore: combine date/username lines on receipt head (52fdbdb)
* Merge #3735 (b68bd3f)
* Merge #3737 (4886914)
* Merge #3739 (f2b3983)
* feat(unpaid invoice) add filter by service (e14ed21)
* fix indicator report missing value (4bfac9a)
* fix: parse <head> contents from XLS renderer (f15481a)
* fix: dismiss fiscal loading indicator once loaded (6b5bd8f)
* fix: account reference dropdown header links (f40a358)
* fix: display correct currency in account footer (9642e6f)
* Merge #3730 (c33886f)

Co-authored-by: Jonathan Niles <jonathanwniles@gmail.com>
@lomamech lomamech deleted the featureMonthlyBalance branch September 10, 2019 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature Monthly Balance Accounts Report
4 participants